home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
icon_utl
/
32to20
/
32to16.frm
next >
Wrap
Text File
|
1995-10-17
|
10KB
|
323 lines
VERSION 2.00
Begin Form IconToBmp
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "32 icon to 20 bmp Converter"
ClientHeight = 2952
ClientLeft = 2328
ClientTop = 2532
ClientWidth = 4932
Height = 3336
Icon = 32TO16.FRX:0000
Left = 2280
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2952
ScaleWidth = 4932
Top = 2196
Width = 5028
Begin CheckBox Check3
BackColor = &H00FFFFFF&
Caption = "Grey BackGround"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 264
Left = 216
TabIndex = 9
Top = 2520
Width = 1596
End
Begin PictureBox Picture2
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 264
Left = 3384
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 8
Top = 672
Width = 264
End
Begin PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H00FFFFFF&
Height = 408
Left = 3384
ScaleHeight = 384
ScaleWidth = 384
TabIndex = 5
Top = 216
Width = 408
End
Begin CommandButton Command1
Caption = "C&onvert"
Default = -1 'True
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 348
Index = 1
Left = 2784
TabIndex = 4
Top = 2520
Width = 972
End
Begin CommandButton Command1
Cancel = -1 'True
Caption = "&Cancel"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 348
Index = 0
Left = 3840
TabIndex = 3
Top = 2520
Width = 972
End
Begin DriveListBox Drive1
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 288
Left = 1488
TabIndex = 2
Top = 1992
Width = 1788
End
Begin DirListBox Dir1
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1752
Left = 1488
TabIndex = 1
Top = 168
Width = 1788
End
Begin FileListBox File1
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 2136
Left = 168
Pattern = "*.ico"
TabIndex = 0
Top = 144
Width = 1260
End
Begin Label Label2
BackStyle = 0 'Transparent
Caption = "This program will convert a 32 by 32 icon to a 20 by 20 bmp. It will convert all the icons in the directory."
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1260
Left = 3384
TabIndex = 10
Top = 1056
Width = 1428
WordWrap = -1 'True
End
Begin Line Line5
BorderColor = &H00808080&
X1 = 192
X2 = 192
Y1 = 2496
Y2 = 2808
End
Begin Line Line4
BorderColor = &H00FFFFFF&
X1 = 1824
X2 = 1824
Y1 = 2808
Y2 = 2496
End
Begin Line Line3
BorderColor = &H00FFFFFF&
X1 = 192
X2 = 1848
Y1 = 2808
Y2 = 2808
End
Begin Line Line2
BorderColor = &H00808080&
X1 = 192
X2 = 1848
Y1 = 2496
Y2 = 2496
End
Begin Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "20x20 Bmp"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 192
Index = 1
Left = 3888
TabIndex = 7
Top = 696
Width = 780
End
Begin Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "32x32 Icon"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 7.8
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 192
Index = 0
Left = 3888
TabIndex = 6
Top = 288
Width = 744
End
Begin Line Line1
BorderColor = &H00FFFFFF&
Index = 1
X1 = 168
X2 = 4800
Y1 = 2424
Y2 = 2424
End
Begin Line Line1
BorderColor = &H00808080&
Index = 0
X1 = 168
X2 = 4800
Y1 = 2400
Y2 = 2400
End
End
Declare Function StretchBlt Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal nSrcHeight%, ByVal dwRop&) As Integer
Const SRCCOPY = &HCC0020
' ************************************************
' * Code written originally by Richard Ratayczak *
' * Put in Public Domain on 10/18/95. *
' * But if you make any money off the code, send *
' * me some! *
' * *
' * Richard Ratayczak *
' * diskdesk@execpc.com *
' * http://www.execpc.com/~diskdesk/ *
' ************************************************
Sub Check3_Click ()
If Check3.Value = 0 Then
Check3.BackColor = &HFFFFFF
Picture1.BackColor = &HFFFFFF
Picture2.BackColor = &HFFFFFF
Else
Check3.BackColor = &HC0C0C0
Picture1.BackColor = &HC0C0C0
Picture2.BackColor = &HC0C0C0
End If
End Sub
Sub Command1_Click (Index As Integer)
Command1(1).Enabled = False
Command1(0).Enabled = False
' ByVal hDC%, ByVal X%, ByVal Y%
' ByVal nWidth%, ByVal nHeight%
' ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%
' ByVal nSrcWidth%, ByVal nSrcHeight%
' ByVal dwRop&
Dim FileName As String
If Index = 1 Then
ChDrive Drive1.Drive
ChDir File1.Path
If File1.ListCount <> -1 Then
For A = 0 To File1.ListCount - 1
File1.ListIndex = A
Picture1.Picture = LoadPicture(File1.List(A))
Picture1.Refresh
X% = StretchBlt(Picture2.hDC, 0, 0, 20, 20, Picture1.hDC, 0, 0, 32, 32, SRCCOPY)
Picture2.Picture = Picture2.Image
Picture2.Refresh
FileName = Left$(File1.List(A), Len(File1.List(A)) - 3) + "bmp"
SavePicture Picture2.Image, FileName
Next A
End If
Command1(1).Enabled = True
Command1(0).Enabled = True
End If
If Index = 0 Then End
End Sub
Sub Dir1_Change ()
File1.Path = Dir1.Path
End Sub
Sub Drive1_Change ()
Dir1.Path = Drive1.Drive
End Sub
Sub File1_Click ()
ChDrive Drive1.Drive
ChDir Dir1.Path
Picture1.Picture = LoadPicture(File1.FileName)
Picture1.Refresh
End Sub
Sub File1_DblClick ()
ChDrive Drive1.Drive
ChDir Dir1.Path
Picture1.Picture = LoadPicture(File1.FileName)
Picture1.Refresh
X% = StretchBlt(Picture2.hDC, 0, 0, 20, 20, Picture1.hDC, 0, 0, 32, 32, SRCCOPY)
Picture2.Picture = Picture2.Image
Picture2.Refresh
FileName = Left$(File1.List(A), Len(File1.List(A)) - 3) + "bmp"
SavePicture Picture2.Image, FileName
End Sub
Sub Form_Load ()
top = screen.Height / 2 - Me.Height / 2
left = screen.Width / 2 - Me.Width / 2
End Sub
Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
'If Button = 1 Then
' File1.Pattern = "*.ico"
'Else
' File1.Pattern = "*.bmp"
'End If
End Sub